package com.androidx.p013lv.base.adapter;

import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import com.androidx.p013lv.base.C1010R;
import com.androidx.p013lv.base.bean.AdInfoBean;
import com.androidx.p013lv.base.utils.UiUtils;
import com.bumptech.glide.Glide;
import com.bumptech.glide.RequestBuilder;
import com.bumptech.glide.RequestManager;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.youth.banner.adapter.BannerAdapter;
import java.util.List;

/* renamed from: com.androidx.lv.base.adapter.RadiusBannerAdapter */
public class RadiusBannerAdapter extends BannerAdapter<AdInfoBean, BannerViewHolder> {
    String domain;
    Fragment fragment;

    public RadiusBannerAdapter(List<AdInfoBean> list, String str, Fragment fragment2) {
        super(list);
        this.fragment = fragment2;
        this.domain = str;
    }

    @Override // com.youth.banner.adapter.IViewHolder
    public BannerViewHolder onCreateHolder(ViewGroup viewGroup, int i) {
        ImageView imageView = new ImageView(viewGroup.getContext());
        imageView.setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        return new BannerViewHolder(imageView);
    }

    public void onBindView(BannerViewHolder bannerViewHolder, AdInfoBean adInfoBean, int i, int i2) {
        Fragment fragment2 = this.fragment;
        if (fragment2 != null) {
            RequestManager with = Glide.with(fragment2);
            ((RequestBuilder) ((RequestBuilder) with.load(this.domain + adInfoBean.getAdImage()).placeholder(C1010R.C1012drawable.base_ic_default_banner)).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(4)))).into(bannerViewHolder.imageView);
            return;
        }
        RequestManager with2 = Glide.with(bannerViewHolder.imageView.getContext());
        ((RequestBuilder) ((RequestBuilder) with2.load(this.domain + adInfoBean.getAdImage()).placeholder(C1010R.C1012drawable.base_ic_default_banner)).transform(new CenterCrop(), new RoundedCorners(UiUtils.dp2px(4)))).into(bannerViewHolder.imageView);
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.androidx.lv.base.adapter.RadiusBannerAdapter$BannerViewHolder */
    public static class BannerViewHolder extends RecyclerView.ViewHolder {
        ImageView imageView;

        public BannerViewHolder(ImageView imageView2) {
            super(imageView2);
            this.imageView = imageView2;
        }
    }
}
